package com.xugongzhang.spring.beans;

import com.xugongzhang.spring.annotations.Length;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author X
 * @date 2022/12/1 1:04
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Person {
    
    private String id;

    @Length(min = 3, max = 30, errorMsg = "姓名长度必须3-30之间")
    private String name;
  
    private Integer age;
    
    public void init() {
        System.out.println("person初始化");
    }
    
    public void destroy() {
        System.out.println("person销毁");
    }
}
